﻿<Window x:Class="BookManager.Views.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="SettingsWindow" Height="300" Width="300">

    <Grid VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style x:Key="FieldLabelStyle" TargetType="TextBlock">
                <Setter Property="Grid.Column" Value="0" />
                <Setter Property="Margin" Value="3,0" />
                <Setter Property="HorizontalAlignment" Value="Right" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
            <Style x:Key="FieldValueStyle" TargetType="FrameworkElement">
                <Setter Property="Grid.Column" Value="1" />
                <Setter Property="Margin" Value="0,3" />
            </Style>
        </Grid.Resources>

        <TextBlock Name="txtbBookListItemWidth" Style="{StaticResource FieldLabelStyle}" Text="Book List Item Width" />
        <TextBox Name="txtBookListItemWidth" Style="{StaticResource FieldValueStyle}" 
                 Text="{Binding MySettings_Shallow.BookListItemWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

        <TextBlock Name="txtbBookShelfItemWidth" Grid.Row="1" Style="{StaticResource FieldLabelStyle}" Text="Book Shelf Item Width" />
        <TextBox Name="txtBookShelfItemWidth" Grid.Row="1" Style="{StaticResource FieldValueStyle}" 
                 Text="{Binding MySettings_Shallow.BookShelfItemWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

        <TextBlock Name="txtbNoResultText" Grid.Row="2" Style="{StaticResource FieldLabelStyle}" Text="No Result Text" />
        <TextBox Name="txtNoResultText" Grid.Row="2" Style="{StaticResource FieldValueStyle}" 
                 Text="{Binding MySettings_Shallow.NoResultText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

        <!--<TextBlock Name="txtb" Text="BookListItemWidth" />
        <TextBox Name="txt" Text="{Binding BookListItemWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->

        <StackPanel Name="stkCommands" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Right"
                    Orientation="Horizontal" Style="{StaticResource FieldValueStyle}">
            <Button Name="btnRestoreSettings" Content="Restore Settings" Command="{Binding RestoreSettingsCommand}" />
            <Button Name="btnSaveSettings" Content="Save settings" Command="{Binding SaveSettingsCommand}" />
        </StackPanel>
    </Grid>
</Window>
